<!DOCTYPE html>
<html>

<head>
  <meta charset="UTF-8">
  <title>yuque编辑器</title>
  <link rel="stylesheet" type="text/css"
    href="https://gw.alipayobjects.com/render/p/yuyan_npm/@alipay_lakex-doc/1.24.0/umd/doc.css" />
  <link rel="stylesheet" type="text/css" href="https://unpkg.com/antd@4.24.13/dist/antd.css" />
</head>

<body>
  <div id="root" class="ne-doc-major-editor"></div>
  <script>
    window.onload = function () {
      const { createOpenEditor } = window.Doc;
      // 创建编辑器
      const editor = createOpenEditor(document.getElementById('root'), {
        input: {},
        image: {
          isCaptureImageURL() {
            return false;
          },
        },
      });
      // 设置内容
      editor.setDocument('text/lake', '<p><span style="color: rgb(255, 111, 4),rgb(243, 48, 171)">欢迎来到yuque编辑器</span></p>');
      // 监听内容变动
      editor.on('contentchange', () => {
        console.info(editor.getDocument('text/lake'));
      });
    }
  </script>
  <script crossorigin src="https://unpkg.com/react@18/umd/react.production.min.js"></script>
  <script crossorigin src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script>\
  <script src="https://gw.alipayobjects.com/render/p/yuyan_npm/@alipay_lakex-doc/1.24.0/umd/doc.umd.js"></script>
</body>

</html>